<!--
 * @Description: 属性选择器
 * @Author: rendc
 * @Date: 2021-08-05 16:36:39
 * @LastEditors: rendc
 * @LastEditTime: 2021-08-05 17:22:50
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>属性选择器</title>
  <style>
    /* 属性选择器 */
    [class~=di] {
      color: greenyellow;
    }
  </style>
</head>

<body>
  <div id="app">

    <div title="d" class="myDiv" id="two">d</div>
    <div title="di" class="myDiv" id="two">di</div>
    <div title="div2myDiv" class="myDiv" id="two">2</div>
    <div class="myDiv" id="three">
      <p class="myP">p2-1</p>
      <div title="div123myDiv">123</div>
      <!-- <p class="">p2-2</p>
      <p class="">p2-2</p>
      <p class="">p2-2</p> -->
      <p>p2-3</p>
      <div title="div3">3</div>
      <div>4</div>
      <div>5</div>
    </div>
  </div>
</body>

</html>